//
//  BMPhotoIOPhotoModel.h
//  bigmama
//
//  Created by huyuchen on 2017/9/28.
//  Copyright © 2017年 盛成文化. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <Photos/Photos.h>
#import <AssetsLibrary/AssetsLibrary.h>

typedef NS_ENUM(NSInteger,BMPhotoIOPhotoType){
    BMPhotoIOPhotoTypePhoto = 1,    //照片
    BMPhotoIOPhotoTypeCamera,       //相机
};

@interface BMPhotoIOPhotoModel : NSObject

// 创建日期
@property (nonatomic, strong) NSDate *createDate;

// 创建日期字符创
@property (nonatomic, copy) NSString *createDateString;

// 原图
@property (nonatomic, strong) UIImage *originalImage;

// 缩略图
@property (nonatomic, strong) UIImage *thumbImage;

// 缩略图
@property (nonatomic, strong) UIImage *cacheImage;

// 照片对象
@property (nonatomic, strong) PHAsset *asset;

// 照片对象IOS7
@property (nonatomic, strong) ALAsset *assetIOS7;

// 索引
@property (nonatomic, copy) NSString *assetID;

// 是否选中
@property (nonatomic, assign, getter=isSelected) BOOL selected;

// 所在indexPath
@property (nonatomic, weak) NSIndexPath *indexPath;

// 当前类型
@property (nonatomic, assign) BMPhotoIOPhotoType type;

// 位置
@property (nonatomic, strong) CLLocation *location;

// 记录是否上传过
@property (nonatomic, assign) BOOL isUploaded;

// 上传过的url
@property (nonatomic, copy) NSString *imageUrl;

// 图片原图大小
@property (nonatomic, assign) CGSize imageSize;

// 图片是否上传过
@property (nonatomic, assign, getter=photoIsUploaded) BOOL photoUploaded;


/**
 获取地址
 
 @param block 回调，传出地址
 */
- (void)getLocationNameBlock:(void (^)(id obj))block;

+ (instancetype)cameraModel;

- (void)getThumbImage_BM;
- (void)getOriginalImage_BM;
@end
